import React from 'react';
import Film from './film';
require( '../../css/films.css');

export default class Films extends React.Component{
    constructor(props){
        super(props);
    }
    renderList(data){
        let _dom = [];
        for(let d in data){
            _dom.push(
                <Film
                    key={d}
                    id={d}
                    cat = {data[d].category}
                    date = {data[d].date}
                    hospital = {data[d].hospital}
                    report = {data[d].report}
                />
            )
        }
        return _dom
    }
    render(){
        return (
            <div className="film-list">{this.renderList(this.props.data)}</div>
        )
    }
}